<?php
function selectCategory($category,$tree,$html)
{
	$text =  $category['ListCategory']['name'];
	$out = $html->tag('span',$text,array('class'=>'category-title'));
	if($category['ListCategory']['childrenCount'] > 0)
	{
		$out .= '<span>('.$category['ListCategory']['childrenCount'].')</span>';
	}else
	{
		$out .= $html->link(__('Select'),'#selectedCategory',array('onclick'=>'selectParent(this,'.$category['ListCategory']['id'].');return false;'));
	}
	return $out;
}
$isTop = empty($this->params['pass'][0]) ||$this->params['pass'][0]=='null' ;

echo $tree->showTree($children,$isTop,'selectCategory',array('id'=>':id'),array('animate'=>true,'autoclose'=> true));
?>